<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sub_account_assign_staff_logs', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('sub_account_id')->comment('子账号id');
            $table->unsignedInteger('assign_admin_id')->comment('分配人id');
            $table->unsignedInteger('staff_id')->comment('客服id');
            $table->tinyInteger('is_backup')->default(0)->comment('是否顶岗：默认0否，1是');

            $table->timestamps();
        });

        \DB::statement("ALTER TABLE `sub_account_assign_staff_logs` comment '子账号分配客服记录'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sub_account_assign_staff_logs');
    }
};
